//
//  NetworkTools.h
//  OC网络请求封装
//
//  Created by Apple on 16/9/18.
//  Copyright © 2016年 KY. All rights reserved.
//




#import <Foundation/Foundation.h>

#import "AFNetworking.h"


//extern NSString *WeiboAppKey;
//extern NSString *WeiboAppSecret;
//extern NSString *WeiboRedirect_Uri;

//  请求方式
typedef enum : NSUInteger {
    GET,
    POST
} ReqeustType;


@interface HMNetworkTools : AFHTTPSessionManager
+ (instancetype)sharedTools;

//  测试使用
- (void)requestWithType: (ReqeustType)type andUrl: (NSString *)url andParams: (id)params andCallBack: (void (^) (id result, NSError *error))callBack;

////  根据code获取accesstoken
-(void)requestAccessTokenWithCode:(NSString *)code andCallBack: (void (^) (id result, NSError *error))callBack;
    
    //  通过Accesstoken获取用户信息
-(void)requestUserInfoWithAccessToken:(NSString *)accessToken uid:(int64_t)uid andCallBack: (void (^) (id result, NSError *error))callBack;

//****************************微博首页相关接口
-(void)requestStatusesWithAccessToken:(NSString *)accessToken maxId:(int64_t)maxId sinceId:(int64_t)sinceId andCallBack:(void (^)(id, NSError *))callBack;



//*********************************发微博相关接口
//只有文字的接口
-(void)updateWithAccess_token:(NSString *)accessToken status:(NSString *)status andCallBack:(void(^)(id,NSError *))callBack;

-(void)updateWithAccess_token:(NSString *)accessToken status:(NSString *)status image:(UIImage *)image andCallBack:(void(^)(id,NSError *))callBack;
@end

